﻿@{
    Layout = null;
}

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>Invitee Admin | Log in</title>
    <!-- Tell the browser to be responsive to screen width -->
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <!-- Font Awesome Icons -->
    <link rel="stylesheet" href="~/WebCore/plugins/fontawesome-free/css/all.min.css">
    <!-- Theme style -->
    <link rel="stylesheet" href="~/WebCore/dist/css/adminlte.min.css">
    <!-- Ionicons -->
    <link rel="stylesheet" href="https://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css">
    <!-- icheck bootstrap -->
    <link rel="stylesheet" href="~/WebCore/plugins/icheck-bootstrap/icheck-bootstrap.min.css">
    <!-- Google Font: Source Sans Pro -->
    <link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700" rel="stylesheet">
    <!-- Toastr -->
    <link rel="stylesheet" href="~/WebCore/plugins/toastr/toastr.min.css">
</head>
<body class="hold-transition login-page">
    <div class="login-box">
        <div class="login-logo">
            <a href="#"><b>Invitee</b></a>
        </div>
        <!-- /.login-logo -->
        <!-- /.login-logo -->
        @if (ViewBag.Success)
        {
            <div class="card">
                <div class="card-body login-card-body">
                    <h4 class="login-box-msg">Forgot Password?</h4>
                    <p>@ViewBag.Message</p>
                    <form action="@Url.Action("Index", "Login")" method="post">
                        <div class="row">
                            <div class="col-6">
                                <input type="submit" class="btn btn-primary btn-block" value="Back to Login" />
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        }
        else
        {
            <div class="card">
                @using (Html.BeginForm("ForgetPassword", "Login", FormMethod.Post, new { @id = "forgetForm" }))
                {
                    <div class="card-body login-card-body">
                        <h4 class="login-box-msg">Forgot Password?</h4>
                        <p>Enter your e-mail address and we'll send you a link to reset your password.</p>
                        <div class="form-group">
                            <label for="exampleInputEmail1">Email</label>
                            <input type="email" name="Email" class="form-control" id="exampleInputEmail1" placeholder="Enter email">
                            @if (ViewBag.Message != null)
                            {
                                <span>@ViewBag.Message</span>
                            }
                        </div>
                        <div class="row">
                            <div class="col-6">
                                <input type="submit" class="btn btn-primary btn-block" value="Reset Password" />
                            </div>
                        </div>
                    </div>
                }
            </div>
        }
    </div>
    <!-- /.login-box -->
    <!-- REQUIRED SCRIPTS -->
    <!-- jQuery -->
    <script src="~/WebCore/plugins/jquery/jquery.min.js"></script>
    <!-- Bootstrap 4 -->
    <script src="~/WebCore/plugins/bootstrap/js/bootstrap.bundle.min.js"></script>

    <!-- Toastr -->
    <script src="~/WebCore/plugins/toastr/toastr.min.js"></script>

    <!-- AdminLTE App -->
    <script src="~/WebCore/dist/js/adminlte.min.js"></script>

    @if (ViewBag.Message != null)
    {
        <script>toastr.error('@ViewBag.Message')</script>
    }
    <script type="text/javascript">
        $(document).ready(function () {
            $('#forgetForm').validate({
                rules: {
                    Email: {
                        required: true,
                        email: true,
                    }
                },
                messages: {
                    Email: {
                        required: "Please enter email address",
                        email: "Please enter a vaild email address"
                    }
                },
                errorElement: 'span',
                errorPlacement: function (error, element) {
                    error.addClass('invalid-feedback');
                    element.closest('.form-group').append(error);
                },
                highlight: function (element, errorClass, validClass) {
                    $(element).addClass('is-invalid');
                },
                unhighlight: function (element, errorClass, validClass) {
                    $(element).removeClass('is-invalid');
                }
            });
        });
    </script>
</body>
</html>